home *** CD-ROM | disk | FTP | other *** search
/ Atari Forever 4 / Atari Forever 4.zip / Atari Forever 4.iso / SERIE_AI / AI_085 / GTK08500 / DOC / FORMATS.TXT next >
Text File  |  1998-03-14  |  22KB  |  416 lines

  1. *******************************************************************************
  2. *                                                                             *
  3. *         Official formats of the Graoumf Tracker modules .GT2 v1 - v3        *
  4. *                            and old GT modules .GTK                          *
  5. *                                                                             *
  6. *                           By L. de Soras - 31/08/95                         *
  7. *                                                                             *
  8. *******************************************************************************
  9.  
  10.  
  11.  
  12. ===============================================================================
  13.            Format of GT2 modules
  14. ===============================================================================
  15.  
  16.     This format is composed of various chunks. They must follow them (but not
  17. necessarily in order), in this way you can read them easily. Put in your module
  18. just the chunks you need. Intel coders, be careful : all words and double words
  19. are in Motorola format, LSByte stored AFTER MSByte.
  20.     You may NOT expect that the first pattern chunk is 12 bytes after the
  21. pattern set chunk, for example. Although it usually is, this may change in
  22. future releases. In addition, it's possible that a chunk even doesn't exist in
  23. the file. Therefore, you MUST check the chunk ID before accessing the chunk.
  24. Finally, when writing GT2's you set undefined/reserved fields to zeros.
  25.     Note : chunk length can be odd.
  26.  
  27.  
  28.  
  29. General info chunk
  30. ~~~~~~~~~~~~~~~~~~
  31.  
  32.     This is always the first chunk.
  33.  
  34. +--------+-------+------------------------------------------------------------+
  35. |      0 |     3 | 'GT2' File magic                                           |
  36. |      3 |     1 | Version of the format (not in ascii!) :                    |
  37. |        |       |     $01 : G.T. v0.7                                        |
  38. |        |       |     $02 : G.T. v0.726                                      |
  39. |        |       |     $03 : G.T. v0.731                                       |
  40. |      4 |     4 | Chunk size. It's the total length of the chunk, included   |
  41. |        |       | id and this dword.                                         |
  42. +--------+-------+------------------------------------------------------------+
  43. |      8 |    32 | Name of the module.                                        |
  44. +--------+-------+------------------------------------------------------------+
  45. |     40 |   160 | Small comments, name of the author                         |
  46. +--------+-------+------------------------------------------------------------+
  47. |    200 |     4 | Date                                                       |
  48. |        |       |     Day   : 1 byte                                         |
  49. |        |       |     Month : 1 byte                                         |
  50. |        |       |     Year  : 1 word                                         |
  51. +--------+-------+------------------------------------------------------------+
  52. |    204 |    24 | Name of the tracker of creation                            |
  53. +--------+-------+------------------------------------------------------------+
  54. |    228 |     2 | Initial speed (Beat length * 6)                            |
  55. |    230 |     2 | Initial tempo (BPM)                                        |
  56. +--------+-------+------------------------------------------------------------+
  57. |    232 |     2 | Initial master volume (000..FFF)                           |
  58. |        |       | Shouldn't excess $600. You can calculate it:               |
  59. |        |       |     MasterVol = $3000 / (NbrTrack + 3)                     |
  60. +--------+-------+------------------------------------------------------------+
  61. |    234 |     2 | Number of voices (just for this panning section)           |
  62. |    236 |   n*2 | Panning for each voice (000..800..FFF)                     |
  63. +--------+-------+------------------------------------------------------------+
  64.  
  65.  
  66.  
  67. Extra-comment chunk (v2)
  68. ~~~~~~~~~~~~~~~~~~~~~~~~
  69.  
  70. +--------+-------+------------------------------------------------------------+
  71. |      0 |     4 | 'XCOM'                                                     |
  72. |      4 |     4 | Chunk size                                                 |
  73. +--------+-------+------------------------------------------------------------+
  74. |      8 |     4 | Extra-comment length                                       |
  75. |     12 |   ECL | Extra-comment                                              |
  76. +--------+-------+------------------------------------------------------------+
  77.  
  78.  
  79.  
  80. Tracker configuration chunk
  81. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  82.  
  83.     This chunk is specific to the Graoumf Tracker.
  84.  
  85. +--------+-------+------------------------------------------------------------+
  86. |      0 |     4 | 'TCN1'                                                     |
  87. |      4 |     4 | Chunk size                                                 |
  88. +--------+-------+------------------------------------------------------------+
  89. |      8 |     2 | Version number                                             |
  90. +--------+-------+------------------------------------------------------------+
  91. | Version 0 :                                                                 |
  92. |     10 |     2 | Song position                                              |
  93. |     12 |     2 | line position                                              |
  94. |     14 |     2 | Preset number                                              |
  95. |     16 |     2 | Pattern display type                                       |
  96. |        |       |     0 : Note and instrument                                |
  97. |        |       |     1 : Note, instrument and effect                        |
  98. |        |       |     2 : Note, instrument, effect and volume                |
  99. |     18 |     2 | Curseur position #1 (column number, on screen)             |
  100. |     20 |     2 | Curseur position #2                                        |
  101. |        |       |     0   : Note                                             |
  102. |        |       |     1-2 : Instrument                                       |
  103. |        |       |     3-6 : Effect                                           |
  104. |        |       |     7-8 : Volume column                                    |
  105. |     22 |     2 | Flags :                                                    |
  106. |        |       |     Bit 0-1 : Play mode                                    |
  107. |        |       |         00 = stop                                          |
  108. |        |       |         01 = play song                                     |
  109. |        |       |         10 = play pattern                                  |
  110. |        |       |     Bit 2   : Edit                                         |
  111. |     24 |     2 | Lower octave on keyboard (0-6)                             |
  112. |     26 |     2 | Line step                                                  |
  113. |     28 |     2 | Instrument number                                          |
  114. |     30 |     2 | Sample number                                              |
  115. +--------+-------+------------------------------------------------------------+
  116. |     32 |  32*2 | Number of tracks displayed for each preset                 |
  117. |     96 | 32*16 | Name of each preset (16 char strings)                      |
  118. |    608 |32*32*2| 32 track numbers for 32 presets                            |
  119. +--------+-------+------------------------------------------------------------+
  120. |   2654 |     4 | Bits 0-31 : 0 = muted track, 1 = track ok                  |
  121. +--------+-------+------------------------------------------------------------+
  122.  
  123.  
  124.  
  125. Song chunk
  126. ~~~~~~~~~~
  127.  
  128. +--------+-------+------------------------------------------------------------+
  129. |      0 |     4 | 'SONG'                                                     |
  130. |      4 |     4 | Chunk size                                                 |
  131. +--------+-------+------------------------------------------------------------+
  132. |      8 |     2 | Song length                                                |
  133. |     10 |     2 | Song repeat point                                          |
  134. +--------+-------+------------------------------------------------------------+
  135. |     12 |    SL | Song data : pattern numbers, in words                      |
  136. +--------+-------+------------------------------------------------------------+
  137.  
  138.  
  139.  
  140. Pattern set chunk
  141. ~~~~~~~~~~~~~~~~~
  142.  
  143. +--------+-------+------------------------------------------------------------+
  144. |      0 |     4 | 'PATS'                                                     |
  145. |      4 |     4 | Chunk size                                                 |
  146. +--------+-------+------------------------------------------------------------+
  147. |      8 |     2 | Number of tracks for all the song.                         |
  148. |        |       | Perhaps in a future version, patterns will have different  |
  149. |        |       | numbers of tracks, and this value will be the max.         |
  150. +--------+-------+------------------------------------------------------------+
  151. |     10 |     2 | Number of patterns saved                                   |
  152. +--------+-------+------------------------------------------------------------+
  153.  
  154.  
  155.  
  156. Pattern chunk
  157. ~~~~~~~~~~~~~
  158.  
  159. +--------+-------+------------------------------------------------------------+
  160. |      0 |     4 | 'PATD'                                                     |
  161. |      4 |     4 | Chunk size                                                 |
  162. +--------+-------+------------------------------------------------------------+
  163. |      8 |     2 | Pattern number                                             |
  164. |     10 |    16 | Pattern name                                               |
  165. +--------+-------+------------------------------------------------------------+
  166. |     26 |     2 | Codage version : 0                                         |
  167. +--------+-------+------------------------------------------------------------+
  168. | Version 0 (full pattern) :                                                  |
  169. |     28 |     2 | Number of lines                                            |
  170. |     30 |     2 | Number of tracks saved. This word is used only out of a    |
  171. |        |       | module (single chunk) for the moment. Set the same value   |
  172. |        |       | in all patterns                                            |
  173. |     32 | 5*L*T | Pattern, raw data, 5 bytes/note : NN II EEEE VV            |
  174. |        |       |     NN   : Note (24-127), 48 is middle C-2. 0 for no note  |
  175. |        |       |     II   : Instrument (1-255). 0 for no instrument         |
  176. |        |       |     EEEE : Effect, see doc for more details. 0 for no FX   |
  177. |        |       |     VV   : Volume (1-255). 0 for no volume                 |
  178. +--------+-------+------------------------------------------------------------+
  179.  
  180.  
  181.  
  182. Instrument set chunk
  183. ~~~~~~~~~~~~~~~~~~~~
  184.  
  185. +--------+-------+------------------------------------------------------------+
  186. |      0 |     4 | 'ORCH'                                                     |
  187. |      4 |     4 | Chunk size                                                 |
  188. +--------+-------+------------------------------------------------------------+
  189. |      8 |     2 | Number of instruments saved                                |
  190. +--------+-------+------------------------------------------------------------+
  191.  
  192.  
  193.  
  194. Instrument chunk
  195. ~~~~~~~~~~~~~~~~
  196.  
  197. +--------+-------+------------------------------------------------------------+
  198. |      0 |     4 | 'INST'                                                     |
  199. |      4 |     4 | Chunk size (316)                                           |
  200. +--------+-------+------------------------------------------------------------+
  201. |      8 |     2 | Instrument number (1-255)                                  |
  202. |     10 |    28 | Instrument name                                            |
  203. +--------+-------+------------------------------------------------------------+
  204. |     38 |     2 | Instrument type (0 = sample)                               |
  205. +--------+-------+------------------------------------------------------------+
  206. |     40 |     2 | Volume (0-255)                                             |
  207. +--------+-------+------------------------------------------------------------+
  208. |     42 |     2 | Autopanning (000..800..FFF)                                |
  209. |        |       | -1 : no autopannig                                         |
  210. +--------+-------+------------------------------------------------------------+
  211. |     44 |     2 | Volume envelope number (0 = no env)                        |
  212. |     46 |     2 | Tone envelope number (0 = no env)                          |
  213. |     48 |     2 | Pan envelope number (0 = no env)                           |
  214. +--------+-------+------------------------------------------------------------+
  215. |     50 |    10 | Reserved, must be set to 0                                 |
  216. +--------+-------+------------------------------------------------------------+
  217. | For n=0 to 127 :                                                            |
  218. | 60+n*2 |     1 | Sample number for MIDI note n                              |
  219. | 61+n*2 |     1 | Transposition for note n, signed byte                      |
  220. +--------+-------+------------------------------------------------------------+
  221.  
  222.  
  223.  
  224. Sample chunk
  225. ~~~~~~~~~~~~
  226.  
  227. +--------+-------+------------------------------------------------------------+
  228. |      0 |     4 | 'SAMP'                                                     |
  229. |      4 |     4 | Chunk size                                                 |
  230. +--------+-------+------------------------------------------------------------+
  231. |      8 |     2 | Sample number (1-255)                                      |
  232. |     10 |    28 | Sample name                                                |
  233. +--------+-------+------------------------------------------------------------+
  234. |     38 |     2 | Bit 0 : 0 = mono, 1 = stereo                               |
  235. |        |       | Bit 1 : 0 = normal loop, 1 = ping-pong loop (v3)           |
  236. +--------+-------+------------------------------------------------------------+
  237. |     40 |     2 | Autopanning (000..800..FFF)                                |
  238. +--------+-------+------------------------------------------------------------+
  239. |     42 |     2 | Number of bits (8 or 16)                                   |
  240. |     44 |     2 | Sample frequency in Hz (2000-65000)                        |
  241. +--------+-------+------------------------------------------------------------+
  242. |     46 |     4 | Length (in bytes), even                                    |
  243. |     50 |     4 | Repeat start (in bytes), even                              |
  244. |     54 |     4 | Repeat length (in bytes), even                             |
  245. +--------+-------+------------------------------------------------------------+
  246. |     58 |     2 | Volume (0-255)                                             |
  247. +--------+-------+------------------------------------------------------------+
  248. |     60 |     2 | Finetune (-8..+7 -> -1..+7/8 halftone)                     |
  249. +--------+-------+------------------------------------------------------------+
  250. |     62 |     2 | Codage version : 0                                         |
  251. +--------+-------+------------------------------------------------------------+
  252. | Version 0 (raw data) :                                                      |
  253. |     64 |     L | Sample data, signed bytes or words                         |
  254. +--------+-------+------------------------------------------------------------+
  255.  
  256.  
  257.  
  258. Envelope chunk
  259. ~~~~~~~~~~~~~~
  260.  
  261. +--------+-------+------------------------------------------------------------+
  262. |      0 |     4 | 'VENV' (volume),                                           |
  263. |        |       | 'TENV' (tone) or                                           |
  264. |        |       | 'PENV' (panning)                                           |
  265. |      4 |     4 | Chunk size                                                 |
  266. +--------+-------+------------------------------------------------------------+
  267. |      8 |     2 | Envelope number                                            |
  268. |     10 |    20 | Envelope name                                              |
  269. +--------+-------+------------------------------------------------------------+
  270. |     30 |     2 | 'Key Off' offset (from data start)                         |
  271. +--------+-------+------------------------------------------------------------+
  272. |     32 | CS-32 | Envelope data                                              |
  273. +--------+-------+------------------------------------------------------------+
  274.  
  275.     Vol/Tone/Pan envelope codes:
  276.         00        : End
  277.         01 + word : Jump
  278.         02 + word : Wait
  279.         03 + byte : Set Counter
  280.         04        : Loop
  281.         05        : Key Off
  282.  
  283.     Volume envelope codes :
  284.         80 + word : Set Volume (16384 = 100%, max = 32767)
  285.         81 + word : Set Volume step
  286.         82 + word : Set Volume speed
  287.         83        : Tremolo On
  288.         84        : Tremolo Off
  289.         85 + byte : Set Tremolo Width
  290.         86 + byte : Set Tremolo Speed
  291.         87        : Tremor On
  292.         88        : Tremor On
  293.         89        : Set Tremor Time 1
  294.         8A        : Set Tremor Time 2
  295.  
  296.     Tone envelope codes :
  297.         A0 + word : Set Tone (4096 = normal period)
  298.         A1 + word : Set Tone step
  299.         A2 + word : Set Tone speed
  300.         A3        : Vibrato On
  301.         A4        : Vibrato Off
  302.         A5 + byte : Set Vibrato Width
  303.         A6 + byte : Set Vibrato Speed
  304.  
  305.     Panning envelope codes :
  306.         C0 + word : Set Panning (2048 = normal position)
  307.         C1 + word : Set Pan step
  308.         C2 + word : Set Pan speed
  309.  
  310.     Volume = Volume * (EnvVol+Tremolo)/16384 * TremorFlag
  311.     Period = Period * (Tone+Vibrato)/4096
  312.     Panning = Panning + (PanEnv-2048)*(2048-abs(Panning-2048))/2048
  313.  
  314.  
  315.  
  316. End chunk (v3)
  317. ~~~~~~~~~~~~~~
  318.  
  319.     This chunk should end the module and must always exist.
  320.  
  321. +--------+-------+------------------------------------------------------------+
  322. |      0 |     4 | 'ENDC'                                                     |
  323. |      4 |     4 | Chunk size                                                 |
  324. +--------+-------+------------------------------------------------------------+
  325. |      8 |     4 | Total module size                                          |
  326. +--------+-------+------------------------------------------------------------+
  327.  
  328.  
  329.  
  330.  
  331.  
  332. ===============================================================================
  333.     Format of old GTK modules
  334. ===============================================================================
  335.  
  336. Structure des infos samples :
  337. ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
  338.  
  339.     rsreset
  340. name_s:    rs.b    28    ; Nom du sample
  341.     rs.w    7    ; Libre (enfin, réservé pour des améliorations futures)
  342.             ; Doit être mis à 0 !
  343. autobal_s:    rs.w    1    ; Balance automatique, -1 = rien
  344. nbits_s:    rs.w    1    ; 1 = 8 bits, 2 = 16 bits
  345. fech_s:    rs.w    1    ; Fréquence d'échantillonnage du sample (8363 Hz par défaut)
  346. length_s:    rs.l    1    ; Longueur du sample, paire
  347. repeat_s:    rs.l    1    ; Point de bouclage, pair
  348. replen_s:    rs.l    1    ; Longueur de boucle, paire
  349. vol_s:    rs.w    1    ; Volume ($0 à $100)
  350. ftune_s:    rs.w    1    ; Finetune (-8 à +7)
  351. size_s:    rs    1    ; Total : 64 octets
  352.  
  353. ***    Toutes les valeurs sont au format Motorola et non Intel :     ***
  354. ***    l'octet de poids fort en premier, et l'octet de poids faible  ***
  355. ***    faible en dernier (sens de la lecture).                       ***
  356.  
  357.     A titre indicatif, les versions de format 1 et 2 ne diffèrent que par cette
  358. structure :
  359.         - 1 : Taille totale 48 octets, le nom fait 32 caractères et il n'y a ni
  360.               balance, ni nombre de bits, ni fréquence d'échantillonnage.
  361.         - 2 : Toujours 48 octets, le nom passe à 28 caractères, pas de balance.
  362.  
  363.  
  364.  
  365. Structure du module :
  366. ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
  367.  
  368. Nom    Offset        Taille        Fonction
  369. gtk_id:        0          3        Identificateur "GTK"
  370. form_num:        3          1        Numéro de format : le numéro 3
  371. name:        4         32        Nom ASCII (pas de zéro)
  372. comment:       36        160        Commentaire ASCII (pas de zéro)
  373. n_spl:      196          2        Nombre d'instruments (0 à 255)
  374. n_lines:      198          2        Nombre de lignes/pattern (1 à 256)
  375. n_trk:      200          2        Nombre de voies/pattern (1 à 32 ?? ou + ??)
  376. songlen:      202          2        Longueur de la song (1 à 256)
  377. songrep:      204          2        Point de bouclage dans la song (0 à songlen-1)
  378. infos_s:      206        n_spl*size_s    Descriptif des instruments (à partir du numéro 1)
  379. ...
  380. song:      n_spl*size_s    256*2        La song (1 mot = 1 pattern), de la position 0 jusqu'à 255
  381.     + 206
  382. ...
  383. patterns:      n_spl*size_s    (npatmax+1)*n_l*n_t*?    Les patterns, de 0 à npatmax.
  384.     + 718                ? peut être 4 (v3) ou 5 (v4)
  385. ...
  386. samples:      n_spl*size_s            Les samples, 8 ou 16 bits signés
  387.     + (npatmax+1)*n_l*n_t*?
  388.     + 718
  389.  
  390.     le numéro du dernier pattern sauvé est le plus grand pattern de la song, de
  391. 0 à songlen-1.
  392.     Chaque pattern est subdivisé en lignes, et chaque ligne en colonnes. On
  393. obtient ainsi chaque note, codée sur 4 (ou 5) octets :
  394.  
  395.     NN II EE EE (VV)
  396.  
  397.     - NN indique le numéro de la note, de 24 (C-0) à 83 (B-4). 0 = pas de note,
  398.     - II indique le numéro de l'instrument. 0 = pas d'instrument,
  399.     - EEEE représente l'effet et son paramètre. Pour plus de précision dessus,
  400.       se reporter à la documentation du tracker.
  401.     - VV, pour la version 4, indique le volume de la piste (1-255). 0 = pas de
  402.       changement de volume.
  403.  
  404.  
  405.  
  406.     Attention, ce format est un format de préversion! Je ne garantis pas que la
  407. version finale sera telle qelle est décrite ici, alors avant de charger un
  408. module de ce type, contrôlez bien le numéro.
  409.     Vous pouvez obtenir la dernière version de Graoumf Tracker (pour Atari
  410. Falcon 030) auprès de son auteur :
  411.  
  412.                         Laurent de Soras
  413.                         92 avenue Albert 1er
  414.                         92500 Rueil-Malmaison
  415.                         FRANCE
  416.